package com.example.myapplication;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class MainActivity2 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main2);

        TextView movieName = findViewById(R.id.text_name);
        TextView movieIntro = findViewById(R.id.text_intro);
        ImageView movieImg = findViewById(R.id.img);
        Intent intent = getIntent();
        movieName.setText(intent.getStringExtra("movieName"));
        movieIntro.setText(intent.getStringExtra("content"));
        movieImg.setImageResource(intent.getIntExtra("img",R.drawable.dun));

    }

    public void checkMovie(View view) {
        Intent intent = new Intent();
        TextView movieName = findViewById(R.id.text_name);
        intent.putExtra("checkName",movieName.getText());
        setResult(1002,intent);
        finish();
    }
}